package com.zxq.ai.domain.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum CashAccountOperateType {

    DEPOSIT(1, "充值"),
    WITHDRAW(2, "提现"),
    TRANSFER(3, "转账"),
    ;

    private final Integer code;
    private final String desc;

    public static CashAccountOperateType getByCode(Integer code) {
        if (Objects.isNull(code)) {
            return null;
        }

        for (CashAccountOperateType type : CashAccountOperateType.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }


}
